var express = require("express");
var router = express.Router();

/* transfer api json */

router.get("/api/getBillList", function(req, res) {
  return res.json([
    {
      datetime: new Date().getTime(),
      income: 2009.00,
      expend: 100.00,
      contents: [
        { type: "shopping", title: "购物消费", money: 50.00, consumeType: "out" },
        { type: "expend", title: "其他", money: 50.00, consumeType: "out" },
        { type: "sand", title: "兼职外快", money: 1115.00, consumeType: "in" },
        { type: "empty", title: "二手闲置", money: 894.00, consumeType: "in" }
      ]
    },
    {
      datetime: new Date().getTime(),
      income: 1000.00,
      expend: 200.50,
      contents: [
        { type: "sand", title: "兼职外快", money: 815.00, consumeType: "in" },
        { type: "shopping", title: "购物消费", money: 50.00, consumeType: "out" },
        { type: "expend", title: "其他", money: 150.00, consumeType: "out" },
        { type: "empty", title: "二手闲置", money: 185.00, consumeType: "in" }
      ]
    },
    {
      datetime: new Date().getTime(),
      income: 1000.00,
      expend: 200.50,
      contents: [
        { type: "sand", title: "兼职外快", money: 815.00, consumeType: "in" },
        { type: "shopping", title: "购物消费", money: 50.00, consumeType: "out" },
        { type: "expend", title: "其他", money: 150.00, consumeType: "out" },
        { type: "empty", title: "二手闲置", money: 185.00, consumeType: "in" }
      ]
    }
  ]);
});

router.get("/api/getBillDetails", function(req, res) {
  return res.json({
    type: "shopping",
    title: "购物消费",
    money: 26.00,
    datetime: new Date().getTime(),
    consumeType: "Out",
    time: new Date().getTime(),
    recordMode: "手动记账",
    remark: "备注",
    tag: "aaa",
    attachment: {
      attachId: "1",
      attachName: "消费1",
      attachPath: "/"
    }
  });
});

router.get("/api/getBillStatis", function(req, res) {
  return res.json({
    richer: 10.00,
    balance: 10.40,
    expend: 15.30
  });
});

module.exports = router;
